import request from "@/utils/request";

// 查询工艺管理列表
export function listProcessManage(query) {
  return request({
    url: "tech/processManage/list",
    method: "get",
    params: query,
  });
}

// 查询工艺管理详细
export function getProcessManage(id) {
  return request({
    url: "tech/processManage/" + id,
    method: "get",
  });
}

// 新增工艺管理
export function addProcessManage(data) {
  return request({
    url: "tech/processManage",
    method: "post",
    data: data,
  });
}
// 新增工艺管理
export function saveProcessRouteInfo(data) {
  return request({
    url: "tech/processManage/saveProcessRouteInfo",
    method: "post",
    data: data,
  });
}
// 新增工艺管理
export function updateProcessRouteInfoById(data) {
  return request({
    url: "tech/processManage/updateProcessRouteInfoById",
    method: "put",
    data: data,
  });
}

// 修改工艺管理
export function updateProcessManage(data) {
  return request({
    url: "tech/processManage",
    method: "put",
    data: data,
  });
}

// 删除工艺管理
export function delProcessManage(id) {
  return request({
    url: "tech/processManage/" + id,
    method: "delete",
  });
}
// 工艺管理工序树子级
export function getSubProcessManage(params) {
  return request({
    url: "tech/processProcedure/list",
    method: "get",
    params,
  });
}
// 新增工艺管理工序树子级
export function addSubProcessManage(data) {
  return request({
    url: "tech/processProcedure",
    method: "post",
    data,
  });
}
// 新增工艺管理工序树子级
export function upgradeSubProcessManage(data) {
  return request({
    url: "tech/processManage/versionAdd",
    method: "post",
    data,
  });
}
// 新增工艺管理工序树子级
export function getRouteInfo(id) {
  return request({
    url: `tech/processManage/getProcessRouteInfoById/${id}`,
    method: "get",
  });
}

// 查询工艺管理模块-任务模板列表
export function listTaskTemplateList(query) {
  return request({
    url: "tech/techProcessTaskTemplate/list",
    method: "get",
    params: query,
  });
}

// 新增工艺管理模块的任务模板列表
export function addTechProcessTaskTemplate(data) {
  return request({
    url: "tech/techProcessTaskTemplate",
    method: "post",
    data,
  });
}

// 查询工艺管理模块-任务模板列表
export function listProcessTaskTemplateList(query) {
  return request({
    url: "tech/techProcessTaskTemplate/list",
    method: "get",
    params: query,
  });
}

// 删除工艺管理模块-任务模板列表
export function delTechProcessTaskTemplate(id) {
  return request({
    url: "tech/techProcessTaskTemplate/" + id,
    method: "delete",
  });
}
